package {

import flash.display.Stage;
import flash.display.LoaderInfo;
import flash.display.Sprite;
import flash.events.Event;
import flash.utils.Timer;
import controller.RadioController;
import flash.external.ExternalInterface;
/**
 * Radio - live transmittion.(C)Joy Division
 * @author Artem.Kolesnikov yaempechenki@gmail.com
 */
public class OneMorePlayer extends Sprite {


    private var _visual:RadioController;
    private static var localMode:Boolean = false;

    public function OneMorePlayer() {
        if (stage)
            init();
        else
            addEventListener(Event.ADDED_TO_STAGE, init);
    }

    private function init(e:Event = null):void
    {
        removeEventListener(Event.ADDED_TO_STAGE, init);

        localMode = ( stage.loaderInfo.loaderURL.substring( 0, 4 ) == "file" );


        _visual = new RadioController();
        addChild(_visual);
    }

    public function get flashVars() : Object
    {
        return LoaderInfo( stage.loaderInfo ).parameters;
    }

    public static function _callToJS(someData:String):void {
        //trace(someData);
        //if(ExternalInterface.available)
        //	ExternalInterface.call('jsFromFlash', someData);
    }
}
}
